package main

import (
	"fmt"
	"github.com/gin-gonic/gin"
	"specifica_video_manage/cfg"
	"specifica_video_manage/router"
)

func main() {
	r := gin.Default()

	r.LoadHTMLGlob("templates/**/*")

	r.GET("/ping", func(c *gin.Context) {
		c.String(200, "pong")
	})

	router.TaskRouterInit(r) // web端添加任务
	router.ResultRouterInit(r)
	router.RecordRouterInit(r)
	router.JobRouterInit(r)

	fmt.Printf("http://%s/task\n", cfg.SERVER)

	err := r.Run(cfg.SERVER)
	if err != nil {
		fmt.Println("start server catch error =", err.Error())
	}
}
